package com.das.metrocloud.ssoserver.controller;

import com.das.framework.common.extvo.ResultVO;
import com.das.metrocloud.ssoserver.config.AuthKeyConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;



@RestController
@RequestMapping({ "/auth/client" })
public class ClientController
{
    @Autowired
    private AuthKeyConfig keyConfig;


    /**
    *  获取 userPubKey
    **/
    @ResponseBody
    @RequestMapping({ "/userPubKey" })
    public ResultVO getServicePublicKey(final String clientId, final String secret) throws Exception {

        final ResultVO resultVO = new ResultVO();

        resultVO.setData((Object)this.keyConfig.getUserPubKey());

        return resultVO;
    }
}
